<template>
  <div id="">
    <Header v-if="$route.meta.showHeader" @showLoading="showLoading"></Header>
    <router-view/>
    <Loding text="正在进入" v-if="isShowLoading"></Loding>
  </div>
</template>

<script>
import Header from '../../components/Header'
import Loding from '../../components/Loding'
export default {
  name: 'index',
  components: {
    Header, Loding
  },
  created () {
    this.routerName = this.$route.name
  },
  updated () {
    if (this.$route.path.indexOf(this.path) !== -1) {
      this.isShowLoading = false
    }
  },
  data () {
    return {
      path: '',
      routerName: '',
      isShowLoading: false
    }
  },
  mounted() {

  },
  methods: {
    showLoading (path) {
      this.path = path
      this.isShowLoading = true
    }
  }
}
</script>

<style lang="less" scoped>

</style>
